LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := Engine

# LOCAL_CFLAGS := -g

APP_OPTIM := debug

LOCAL_C_INCLUDES += $(LOCAL_PATH)/Engine2d
LOCAL_C_INCLUDES += $(LOCAL_PATH)/Engine3d
LOCAL_C_INCLUDES += $(LOCAL_PATH)/libpng
LOCAL_C_INCLUDES += $(LOCAL_PATH)/Math
LOCAL_C_INCLUDES += $(LOCAL_PATH)/Menu
LOCAL_C_INCLUDES += $(LOCAL_PATH)/Menu/Components
LOCAL_C_INCLUDES += $(LOCAL_PATH)/Other
LOCAL_C_INCLUDES += $(LOCAL_PATH)/Shaders

#Freetype includes
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libs/freetype/include
#assimp includes
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libs/assimp/assimp


FILE_LIST := $(wildcard $(LOCAL_PATH)/Engine2D/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Engine3D/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/FreetypeWrapper/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/libpng/*.c)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Math/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Menu/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Menu/Components/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Other/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Shaders/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/*.cpp)
LOCAL_SRC_FILES += $(FILE_LIST:$(LOCAL_PATH)/%=%)

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/Engine2d
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/Engine3d
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/FreetypeWrapper
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/libpng
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/Math
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/Menu
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/Components
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/Shaders
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/Other

LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/../libs/freetype/include

LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/../libs/assimp/assimp

LOCAL_STATIC_LIBRARIES += libfreetype				#link freetype

LOCAL_EXPORT :=	-llog -lGLESv1_CM -lGLESv2

include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := assimp
LOCAL_PATH	:= $(LOCAL_PATH)/../libs/assimp
LOCAL_SRC_FILES := libassimp.so
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/assimp/assimp
include $(PREBUILT_SHARED_LIBRARY)

#Include external libraries makefiles (LOCAL_PATH is overwritten and pwd is changed to NDK location, so the path has to be absolute)
include /cygdrive/c/Users/Jarek/Projects/Engine/libs/freetype/Android.mk

##### Building fake shared - needed for build to process ####
include $(CLEAR_VARS)

LOCAL_MODULE    := Engine-shared

LOCAL_STATIC_LIBRARIES := Engine

include $(BUILD_SHARED_LIBRARY)